#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "Classifier.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class Operation;
class Property;

/// <summary>
/// DataType
/// A DataType is a type whose instances are identified only by their value.
/// </summary>
class UMLMODEL_EXPORT DataType : public Classifier {

public: // Constructors and destructors
    explicit DataType(const QString& umlType="uml::DataType");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// ownedAttributes getter
    /// The attributes owned by the DataType.
    /// </summary>
    vector<shared_ptr<Property>>& ownedAttributes();

    /// <summary>
    /// ownedOperations getter
    /// The Operations owned by the DataType.
    /// </summary>
    vector<shared_ptr<Operation>>& ownedOperations();

private: // Fields
    /// <summary>
    /// ownedAttributes
    /// The attributes owned by the DataType.
    /// </summary>
    vector<shared_ptr<Property>> ownedAttributes_;

    /// <summary>
    /// ownedOperations
    /// The Operations owned by the DataType.
    /// </summary>
    vector<shared_ptr<Operation>> ownedOperations_;

};

} // namespace uml
